<?php
/**
 * +----------------------------------------------------------------------
 * | Copyright © Sogu Technologies Co. Ltd 2018-2050 All rights reserved.
 * +----------------------------------------------------------------------
 * | File name: BaseModels.php
 * +----------------------------------------------------------------------
 * | Author: sam
 * +----------------------------------------------------------------------
 * | Description: 通用的模型方法trait
 * +----------------------------------------------------------------------
 * | Others: 其他内容的说明
 * +----------------------------------------------------------------------
 * | History: 修改历史记录列表，每条修改记录应包含修改日期、修改者及修改内容简述
 * +----------------------------------------------------------------------
 * | 1.Date: 2019/1/12 Author: sam Modification: 创建
 * +----------------------------------------------------------------------
 */
namespace App\Models\Traits;


trait BaseModels{

    public function updateLogic($params)
    {
        foreach ($params as $attr => $val){
            $this->$attr = $val;
        }
        $this->save();
        return true;
    }
}